package com.icesoft.xsnow.upms.api.remote;

import com.icesoft.xsnow.common.core.constant.SecurityConstants;
import com.icesoft.xsnow.framework.api.reponses.R;
import com.icesoft.xsnow.upms.api.dto.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @program: xsnow
 * @description:
 * @author: xuefeng.gao
 * @create: 2019-05-27 10:34
 **/
@FeignClient(value="xsnow-upms")
public interface RemoteUserService {
    /**
     * 通过用户名查询用户、角色信息
     *
     * @param username 用户名
     * @param from     调用标志
     * @return R
     */
    @GetMapping("/user/info/{username}")
    R<UserInfo> info(@PathVariable("username") String username
            , @RequestHeader(SecurityConstants.FROM) String from);
}
